package test6;

public class Test {
	public static void main(String[] args) {
//		Method[] ms = B.class.getDeclaredMethods();
//		for (Method m : ms) {
//			if (m.isAnnotationPresent(MyAnnotation.class)) {
//				MyAnnotation ma = m.getAnnotation(MyAnnotation.class);
//				System.out.println(ma.name());
//			}
//		}
//
//		Field[] fs = B.class.getDeclaredFields();
//		for (Field f : fs) {
//			if (f.isAnnotationPresent(MyAnnotation.class)) {
//				MyAnnotation ma = f.getAnnotation(MyAnnotation.class);
//				System.out.println(ma.name());
//			}
//		}
		
		Class<C> c = C.class;
		MyAnnotation myAnnotation = c.getAnnotation(MyAnnotation.class);
		System.out.println(myAnnotation.name());
	}
}
